<template>
	<view class="container">
		<view class="status_bar"></view>
		<!--头部-->
		<!-- <view class="head flex-row" @tap="closeSwipe" :style="{'padding-right': posRight}">
			<view class="title">星聊</view>
			<view @tap="toPage('/pages/message/group/create')">创建群聊</view>
		</view> -->
		<!-- @tab="getmessage" -->
		<view class="head flex-row" v-if="!is_more " @tap="closeSwipe" :style="{'padding-right': posRight}">
			<view class="title" style="font-size: 19px;width: 70px;">xsx</view>
			<!-- <view class="title" @tap="toPage('/pages/demo')">ste</view> -->
			<view class="head flex-row">
				<u-search style="width: 55%;" placeholder="请输入您想搜索的内容" v-model="nickname" :showAction="false"
					searchIconColor="#373737" placeholderColor="#bcbcbc" @input="onInput"></u-search>
			</view>
			<view style="display: flex;">
				<u--image @tap="getnotices()" :showLoading="true" src="../../static/image/icon08@3x.png" width="40upx"
					height="40upx" radius="10upx" style="margin: 10upx 10upx  0 0;"></u--image>
				<u-icon name="plus" size=22 style="margin: 10upx 0 0 20upx;" @tap="handleDirlog()"></u-icon>
			</view>
		</view>
		<view class="head flex-row" v-else-if="is_more " :style="{'padding-right': posRight}">
			<view class="title" style="font-size: 19px;width: 70px;">全选</view>
			<!-- <view class="title" @tap="toPage('/pages/demo')">ste</view> -->
			<view class="head flex-row">

			</view>
			<view style="display: flex;" @tap="is_more = false,more_list = []">
				取消
			</view>
		</view>
		<!-- <view class="head flex-row">
			<view class="search-box">
				<u-search placeholder="请输入您想搜索的内容" v-model="keyword" :showAction="false" searchIconColor="#373737"
					placeholderColor="#bcbcbc"></u-search>
			</view>
		</view> -->
		<view style="width: 92%;margin-left: 4%;margin-top: 20upx;margin-bottom: 10px;">
			<!-- 	<view style="display: flex;justify-content: space-between;">
				<u-tabs style="width: 90%;" :list="tabList" @click="clickTabs" :active="activeTab" lineColor="#ea420f"
					lineWidth="34" inactiveStyle="{color:'c8c7cf'}"
					:activeStyle="{color: '#2c2c2c',fontWeight: 'bold',transform: 'scale(1.05)'}">
				</u-tabs>
			</view> -->
			<view class="tabls">
				<view v-for="(item, index) in tabList" :key="item.num" class="bakbox"
					:class="{ active: index === activeTabIndex }" @click="clickTabs(item)">
					{{ item.name }}
					<!-- -->
					<view class="" v-if="item.count"
						style="font-size: 8px;color: #fff;text-align: center; position: absolute; width: 15px;height: 15px;line-height: 15px;background-color: #ff0000;border-radius: 50%;margin-left: 35px;margin-top: -35px;z-index: 11;">
						{{item.count > 10 ? '...':item.count}}
					</view>
				</view>
			</view>

			<view style="margin: -4upx; 0 0 20upx">
				<u-line color="#dcdcdc" length="80%"></u-line>
			</view>
		</view>

		<u-overlay :show="dirlogShow" opacity=0.1 @tap="dirlogShow = false">
			<view class="dirlog-box">
				<view class="dirlog-box1" @tap="toPage('/pages/contacts/newGroupChat')">
					<image src="../../static/image/icon13@3x.png"></image>
					<view>新建群聊</view>
				</view>
				<view class="dirlog-box1" @tap="toPage('/pages/contacts/addFriendsnew?usercode=2')">
					<image src="../../static/image/icon14@3x.png"></image>
					<view>添加好友</view>
				</view>
				
				<view class="dirlog-box1" @tap="scanCode()">
					<image src="../../static/image/icon17@3x.png"></image>
					<view>扫一扫</view>
				</view>
			</view>
		</u-overlay>

		<!--容器-->
		<scroll-view scroll-y class="list">
			<!-- <view class="space" @tap="closeSwipe"></view> -->
			<uni-swipe-action ref="swipe" v-if="num == 0">
				<checkbox-group @change="checkboxChange">

					<uni-swipe-action-item v-for="(item, index) in filteredList" :key="index" style="">
						<view v-if="is_more" style="width: 30px;height: 30px;margin: auto 5px;">
							<checkbox :value="item" :checked="item.multiSelect" />
						</view>
						<delSlideLeft v-if="!is_more" ref="slideLeft" class="" :style="{'width':'100%'}"
							:is_top="item.is_top" :is_mute="item.is_mute" :data_transit="{index:index,item:item}"
							@delItem="delItem">
							<view class="select-box" :class=" item.is_top? 'active':''"
								style="flex: 1; display: flex; padding: 10px 30upx;" @tap="toDetail(item)"
								v-if="item.typeu != 7">
								<view class="name-img" v-if="item.g_id != ''  && item.g_id != '0'">


									<image v-if="item.userAvatar" :src="item.userAvatar" class=""
										style="position: relative;width: 100%;height: 100%;border-radius: 10px;" />
									<!-- :src="`http://chat.zwsmcn.com:8090/BinaryDownloader?action=gavartar_d&user_uid=${userId}&file_name=${item.g_id}.jpg`" -->
									<image v-else
										:src="`http://chat.zwsmcn.com:8090/chatfile/avatar_group/${item.g_id}.jpg`"
										class=""
										style="position: relative;width: 100%;height: 100%;border-radius: 10px;" />
								</view>
								<view class="name-img" v-else-if="item.userAvatar != ''  && item.userAvatar != '0'">
									<image
										:src="`http://chat.zwsmcn.com:8090/UserAvatarDownloader?action=ad&user_uid=${item.user_uid}&user_local_cached_avatar=${item.userAvatar}&enforceDawnload=1`"
										class=""
										style="position: relative;width: 100%;height: 100%;border-radius: 10px;">
									</image>
								</view>
								<view class="name-img" v-else>
									{{ item.nickname == "" ? item.g_name[0] : item.nickname[0] }}

								</view>
								<view class="unread-color" v-if="item.unread_count > 0"
									style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;z-index: 11;">
								</view>
								<view
									style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
									<view
										style="margin-left: 20upx;position: relative; display: flex; align-items: center;">
										<view style="color: #1467cd; margin-right: 6px;"
											v-if="item.g_id != '' && item.g_id != '0'">[群聊]</view>
										<view v-if="item.g_id != '' && item.g_id != '0'"
											style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
											{{ item.g_name}}
										</view>
										<view v-else
											style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
											{{ item.nickname }}
										</view>

										<u-icon v-if="item.is_top == 1" name="pushpin-fill" size='20'
											style="margin: 0 10px;" /></u-icon>
										<!-- 	<image style="width: 70upx; height: 32upx; border-radius: 4px; margin-left: 4px;"
										src="../../static/image/icon-vip@3x.png"></image> -->
									</view>
									<view class="title-box">
										{{item.g_id != '' && item.g_id != '0'?(item.message.f == userId?'我:':`${item.message.nickName}:`):''}}
										{{ checkIfmsg(item.message)}}
									</view>

								</view>
								<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
									mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
								</image>
								<view style="position: absolute; right: 4vw; color: #9c9c9c; font-size: 22upx;">
									{{ formatTime(item.time) }}
								</view>
							</view>
							<view class="select-box" :class=" item.is_top? 'active':''"
								style="flex: 1;display: flex; padding:10px 30upx;" v-else-if="item.typeu == 7"
								@tap="toDetail(item)">
								<image class="name-img1" src="../../static/image/message.png" mode="aspectFit"></image>
								<view class="unread-color" v-if="item.unread_count > 0"
									style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;">
								</view>
								<view
									style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
									<view
										style="margin-left: 20upx;position: relative; display: flex;align-items: center;">

										<view style="max-width: 132px;  
									white-space: nowrap;
									overflow: hidden;
									text-overflow: ellipsis; ">系统消息</view>

										<u-icon v-if="item.is_top == 1" name="pushpin-fill" size='20'
											style="margin: 0 10px;" /></u-icon>
										<!-- <image style="width: 70upx;height: 32upx;border-radius: 4px;margin-left: 4px;"
										src="../../static/image/icon-vip@3x.png">
									</image> -->
									</view>

									<view class="title-box">
										“{{ item.message.nickname }}”请求加您为好友
									</view>
									<!-- <view style="margin: 45upx 0 0 20upx">
										<u-line color="#dcdcdc" length="1000%"></u-line>
									</view> -->
								</view>
								<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
									mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
								</image>
								<view style="position: absolute;right: 4%;color: #9c9c9c; font-size: 22upx;">
									{{ formatTime(item.time) }}
								</view>
							</view>
						</delSlideLeft>

						<view class="" v-else-if="is_more" :style="{'width':is_more? 'calc(100% - 40px)':'100%'}">
							<view class="select-box" :class=" item.is_top? 'active':''"
								style="flex: 1; display: flex; padding: 10px 30upx;" @tap="toDetail(item)"
								v-if="item.typeu != 7">
								<view class="name-img" v-if="item.g_id != ''  && item.g_id != '0'">

									<image v-if="item.userAvatar" :src="item.userAvatar" class=""
										style="position: relative;width: 100%;height: 100%;">
										<image v-else
											:src="`http://chat.zwsmcn.com:8090/BinaryDownloader?action=gavartar_d&user_uid=${userId}&file_name=${item.g_id}.jpg`"
											class="" style="position: relative;width: 100%;height: 100%;">
								</view>
								<view class="name-img" v-else-if="item.userAvatar != ''  && item.userAvatar != '0'">
									<image
										:src="`http://chat.zwsmcn.com:8090/UserAvatarDownloader?action=ad&user_uid=${item.user_uid}&user_local_cached_avatar=${item.userAvatar}&enforceDawnload=1`"
										class="" style="position: relative;width: 100%;height: 100%;">
									</image>
								</view>
								<view class="name-img" v-else>
									{{ item.nickname == "" ? item.g_name[0] : item.nickname[0] }}

								</view>
								<view class="unread-color" v-if="item.unread_count > 0"
									style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;z-index: 11;">
								</view>
								<view
									style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
									<view
										style="margin-left: 20upx;position: relative; display: flex; align-items: center;">
										<view style="color: #1467cd; margin-right: 6px;"
											v-if="item.g_id != '' && item.g_id != '0'">[群聊]</view>
										<view v-if="item.g_id != '' && item.g_id != '0'"
											style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
											{{ item.g_name}}
										</view>
										<view v-else
											style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
											{{ item.nickname }}
										</view>

										<u-icon v-if="item.is_top == 1" name="pushpin-fill" size='20'
											style="margin: 0 10px;" /></u-icon>
										<!-- 	<image style="width: 70upx; height: 32upx; border-radius: 4px; margin-left: 4px;"
											src="../../static/image/icon-vip@3x.png"></image> -->
									</view>
									<view class="title-box">
										{{item.g_id != '' && item.g_id != '0'?(item.message.f == userId?'我:':`${item.message.nickName}:`):''}}
										{{ checkIfmsg(item.message)}}
									</view>
									<!-- <view style="margin: 45upx 0 0 20upx">
										<u-line color="#dcdcdc" length="1000%"></u-line>
									</view> -->
								</view>
								<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
									mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
								</image>
								<view style="position: absolute; right: 4vw; color: #9c9c9c; font-size: 22upx;">
									{{ formatTime(item.time) }}
								</view>
							</view>
							<view class="select-box" :class=" item.is_top? 'active':''"
								style="flex: 1;display: flex; padding:10px 30upx;" v-else-if="item.typeu == 7"
								@tap="toDetail(item)">
								<image class="name-img1" src="../../static/image/message.png" mode="aspectFit"></image>
								<view class="unread-color" v-if="item.unread_count > 0"
									style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;">
								</view>
								<view
									style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
									<view
										style="margin-left: 20upx;position: relative; display: flex;align-items: center;">

										<view style="max-width: 132px;  
										white-space: nowrap;
										overflow: hidden;
										text-overflow: ellipsis; ">系统消息</view>

										<!-- <image style="width: 70upx;height: 32upx;border-radius: 4px;margin-left: 4px;"
											src="../../static/image/icon-vip@3x.png">
										</image> -->
									</view>

									<view class="title-box">
										“{{ item.message.nickname }}”请求加您为好友
									</view>
									<!-- <view style="margin: 45upx 0 0 20upx">
											<u-line color="#dcdcdc" length="1000%"></u-line>
										</view> -->
								</view>
								<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
									mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
								</image>
								<view style="position: absolute;right: 4%;color: #9c9c9c; font-size: 22upx;">
									{{ formatTime(item.time) }}
								</view>
							</view>

						</view>
					</uni-swipe-action-item>
				</checkbox-group>
			</uni-swipe-action>
			<uni-swipe-action ref="swipe" v-if="num==1">
				<uni-swipe-action-item v-for="(item, index) in unreadlist" :key="index">
					<view v-if="is_more" style="width: 30px;height: 30px;margin: auto 5px;">
						<checkbox :value="item" :checked="item.multiSelect" />
					</view>
					<delSlideLeft v-if="!is_more" ref="slideLeft" class="" :style="{'width':'100%'}"
						:is_top="item.is_top" :is_mute="item.is_mute" :data_transit="{index:index,item:item}"
						@delItem="delItem">
						<view class="select-box" :class=" item.is_top? 'active':''"
							style="flex: 1; display: flex; padding: 10px 30upx;" @tap="toDetail(item)"
							v-if="item.typeu != 7">
							<view class="name-img" v-if="item.g_id != ''  && item.g_id != '0'">


								<image v-if="item.userAvatar" :src="item.userAvatar" class=""
									style="position: relative;width: 100%;height: 100%;border-radius: 10px;" />
								<!-- :src="`http://chat.zwsmcn.com:8090/BinaryDownloader?action=gavartar_d&user_uid=${userId}&file_name=${item.g_id}.jpg`" -->
								<image v-else
									:src="`http://chat.zwsmcn.com:8090/chatfile/avatar_group/${item.g_id}.jpg`" class=""
									style="position: relative;width: 100%;height: 100%;border-radius: 10px;" />
							</view>
							<view class="name-img" v-else-if="item.userAvatar != ''  && item.userAvatar != '0'">
								<image
									:src="`http://chat.zwsmcn.com:8090/UserAvatarDownloader?action=ad&user_uid=${item.user_uid}&user_local_cached_avatar=${item.userAvatar}&enforceDawnload=1`"
									class="" style="position: relative;width: 100%;height: 100%;border-radius: 10px;">
								</image>
							</view>
							<view class="name-img" v-else>
								{{ item.nickname == "" ? item.g_name[0] : item.nickname[0] }}

							</view>
							<view class="unread-color" v-if="item.unread_count > 0"
								style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;z-index: 11;">
							</view>
							<view
								style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
								<view
									style="margin-left: 20upx;position: relative; display: flex; align-items: center;">
									<view style="color: #1467cd; margin-right: 6px;"
										v-if="item.g_id != '' && item.g_id != '0'">[群聊]</view>
									<view v-if="item.g_id != '' && item.g_id != '0'"
										style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
										{{ item.g_name}}
									</view>
									<view v-else
										style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
										{{ item.nickname }}
									</view>

									<u-icon v-if="item.is_top == 1" name="pushpin-fill" size='20'
										style="margin: 0 10px;" /></u-icon>
									<!-- 	<image style="width: 70upx; height: 32upx; border-radius: 4px; margin-left: 4px;"
									src="../../static/image/icon-vip@3x.png"></image> -->
								</view>
								<view class="title-box">
									{{item.g_id != '' && item.g_id != '0'?(item.message.f == userId?'我:':`${item.message.nickName}:`):''}}
									{{ checkIfmsg(item.message)}}
								</view>

							</view>
							<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
								mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
							</image>
							<view style="position: absolute; right: 4vw; color: #9c9c9c; font-size: 22upx;">
								{{ formatTime(item.time) }}
							</view>
						</view>
						<view class="select-box" :class=" item.is_top? 'active':''"
							style="flex: 1;display: flex; padding:10px 30upx;" v-else-if="item.typeu == 7"
							@tap="toDetail(item)">
							<image class="name-img1" src="../../static/image/message.png" mode="aspectFit"></image>
							<view class="unread-color" v-if="item.unread_count > 0"
								style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;">
							</view>
							<view
								style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
								<view style="margin-left: 20upx;position: relative; display: flex;align-items: center;">

									<view style="max-width: 132px;  
								white-space: nowrap;
								overflow: hidden;
								text-overflow: ellipsis; ">系统消息</view>

									<u-icon v-if="item.is_top == 1" name="pushpin-fill" size='20'
										style="margin: 0 10px;" /></u-icon>
									<!-- <image style="width: 70upx;height: 32upx;border-radius: 4px;margin-left: 4px;"
									src="../../static/image/icon-vip@3x.png">
								</image> -->
								</view>

								<view class="title-box">
									“{{ item.message.nickname }}”请求加您为好友
								</view>
								<!-- <view style="margin: 45upx 0 0 20upx">
									<u-line color="#dcdcdc" length="1000%"></u-line>
								</view> -->
							</view>
							<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
								mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
							</image>
							<view style="position: absolute;right: 4%;color: #9c9c9c; font-size: 22upx;">
								{{ formatTime(item.time) }}
							</view>
						</view>
					</delSlideLeft>

					<view class="" v-else-if="is_more" :style="{'width':is_more? 'calc(100% - 40px)':'100%'}">
						<view class="select-box" :class=" item.is_top? 'active':''"
							style="flex: 1; display: flex; padding: 10px 30upx;" @tap="toDetail(item)"
							v-if="item.typeu != 7">
							<view class="name-img" v-if="item.g_id != ''  && item.g_id != '0'">

								<image v-if="item.userAvatar" :src="item.userAvatar" class=""
									style="position: relative;width: 100%;height: 100%;">
									<image v-else
										:src="`http://chat.zwsmcn.com:8090/BinaryDownloader?action=gavartar_d&user_uid=${userId}&file_name=${item.g_id}.jpg`"
										class="" style="position: relative;width: 100%;height: 100%;">
							</view>
							<view class="name-img" v-else-if="item.userAvatar != ''  && item.userAvatar != '0'">
								<image
									:src="`http://chat.zwsmcn.com:8090/UserAvatarDownloader?action=ad&user_uid=${item.user_uid}&user_local_cached_avatar=${item.userAvatar}&enforceDawnload=1`"
									class="" style="position: relative;width: 100%;height: 100%;">
								</image>
							</view>
							<view class="name-img" v-else>
								{{ item.nickname == "" ? item.g_name[0] : item.nickname[0] }}

							</view>
							<view class="unread-color" v-if="item.unread_count > 0"
								style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;z-index: 11;">
							</view>
							<view
								style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
								<view
									style="margin-left: 20upx;position: relative; display: flex; align-items: center;">
									<view style="color: #1467cd; margin-right: 6px;"
										v-if="item.g_id != '' && item.g_id != '0'">[群聊]</view>
									<view v-if="item.g_id != '' && item.g_id != '0'"
										style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
										{{ item.g_name}}
									</view>
									<view v-else
										style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
										{{ item.nickname }}
									</view>

									<u-icon v-if="item.is_top == 1" name="pushpin-fill" size='20'
										style="margin: 0 10px;" /></u-icon>
									<!-- 	<image style="width: 70upx; height: 32upx; border-radius: 4px; margin-left: 4px;"
										src="../../static/image/icon-vip@3x.png"></image> -->
								</view>
								<view class="title-box">
									{{item.g_id != '' && item.g_id != '0'?(item.message.f == userId?'我:':`${item.message.nickName}:`):''}}
									{{ checkIfmsg(item.message)}}
								</view>

							</view>
							<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
								mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
							</image>
							<view style="position: absolute; right: 4vw; color: #9c9c9c; font-size: 22upx;">
								{{ formatTime(item.time) }}
							</view>
						</view>
						<view class="select-box" :class=" item.is_top? 'active':''"
							style="flex: 1;display: flex; padding:10px 30upx;" v-else-if="item.typeu == 7"
							@tap="toDetail(item)">
							<image class="name-img1" src="../../static/image/message.png" mode="aspectFit"></image>
							<view class="unread-color" v-if="item.unread_count > 0"
								style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;">
							</view>
							<view
								style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
								<view style="margin-left: 20upx;position: relative; display: flex;align-items: center;">

									<view style="max-width: 132px;  
									white-space: nowrap;
									overflow: hidden;
									text-overflow: ellipsis; ">系统消息</view>

									<!-- <image style="width: 70upx;height: 32upx;border-radius: 4px;margin-left: 4px;"
										src="../../static/image/icon-vip@3x.png">
									</image> -->
								</view>

								<view class="title-box">
									“{{ item.message.nickname }}”请求加您为好友
								</view>

							</view>
							<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
								mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
							</image>
							<view style="position: absolute;right: 4%;color: #9c9c9c; font-size: 22upx;">
								{{ formatTime(item.time) }}
							</view>
						</view>

					</view>
				</uni-swipe-action-item>
			</uni-swipe-action>
			<uni-swipe-action ref="swipe" v-if="num == 2">
				<checkbox-group @change="checkboxChange">

					<uni-swipe-action-item v-for="(item, index) in singlelist" :key="index" style="">
						<view v-if="is_more" style="width: 30px;height: 30px;margin: auto 5px;">
							<checkbox :value="item" :checked="item.multiSelect" />
						</view>
						<delSlideLeft v-if="!is_more" ref="slideLeft" class="" :style="{'width':'100%'}"
							:is_top="item.is_top" :is_mute="item.is_mute" :data_transit="{index:index,item:item}"
							@delItem="delItem">
							<view class="select-box" :class=" item.is_top? 'active':''"
								style="flex: 1; display: flex; padding: 10px 30upx;" @tap="toDetail(item)"
								v-if="item.typeu != 7">

								<view class="name-img" v-if="item.userAvatar != ''  && item.userAvatar != '0'">
									<image
										:src="`http://chat.zwsmcn.com:8090/UserAvatarDownloader?action=ad&user_uid=${item.user_uid}&user_local_cached_avatar=${item.userAvatar}&enforceDawnload=1`"
										class=""
										style="position: relative;width: 100%;height: 100%;border-radius: 10px;">
									</image>
								</view>
								<view class="name-img" v-else>
									{{ item.nickname == "" ? item.g_name[0] : item.nickname[0] }}

								</view>
								<view class="unread-color" v-if="item.unread_count > 0"
									style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;z-index: 11;">
								</view>
								<view
									style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
									<view
										style="margin-left: 20upx;position: relative; display: flex; align-items: center;">

										<view
											style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
											{{ item.nickname }}
										</view>

										<u-icon v-if="item.is_top == 1" name="pushpin-fill" size='20'
											style="margin: 0 10px;" /></u-icon>
										<!-- 	<image style="width: 70upx; height: 32upx; border-radius: 4px; margin-left: 4px;"
										src="../../static/image/icon-vip@3x.png"></image> -->
									</view>
									<view class="title-box">
										{{item.g_id != '' && item.g_id != '0'?(item.message.f == userId?'我:':`${item.message.nickName}:`):''}}
										{{ checkIfmsg(item.message)}}
									</view>
									<!-- <view style="margin: 45upx 0 0 20upx">
									<u-line color="#dcdcdc" length="1000%"></u-line>
								</view> -->
								</view>
								<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
									mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
								</image>
								<view style="position: absolute; right: 4vw; color: #9c9c9c; font-size: 22upx;">
									{{ formatTime(item.time) }}
								</view>
							</view>
							<view class="select-box" :class=" item.is_top? 'active':''"
								style="flex: 1;display: flex; padding:10px 30upx;" v-else-if="item.typeu == 7"
								@tap="toDetail(item)">
								<image class="name-img1" src="../../static/image/message.png" mode="aspectFit"></image>
								<view class="unread-color" v-if="item.unread_count > 0"
									style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;">
								</view>
								<view
									style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
									<view
										style="margin-left: 20upx;position: relative; display: flex;align-items: center;">

										<view style="max-width: 132px;  
									white-space: nowrap;
									overflow: hidden;
									text-overflow: ellipsis; ">系统消息</view>

										<u-icon v-if="item.is_top == 1" name="pushpin-fill" size='20'
											style="margin: 0 10px;" /></u-icon>
										<!-- <image style="width: 70upx;height: 32upx;border-radius: 4px;margin-left: 4px;"
										src="../../static/image/icon-vip@3x.png">
									</image> -->
									</view>

									<view class="title-box">
										“{{ item.message.nickname }}”请求加您为好友
									</view>
									<!-- <view style="margin: 45upx 0 0 20upx">
										<u-line color="#dcdcdc" length="1000%"></u-line>
									</view> -->
								</view>
								<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
									mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
								</image>
								<view style="position: absolute;right: 4%;color: #9c9c9c; font-size: 22upx;">
									{{ formatTime(item.time) }}
								</view>
							</view>
						</delSlideLeft>

						<view class="" v-else-if="is_more" :style="{'width':is_more? 'calc(100% - 40px)':'100%'}">
							<view class="select-box" :class=" item.is_top? 'active':''"
								style="flex: 1; display: flex; padding: 10px 30upx;" @tap="toDetail(item)"
								v-if="item.typeu != 7">
								<view class="name-img" v-if="item.g_id != ''  && item.g_id != '0'">

									<image v-if="item.userAvatar" :src="item.userAvatar" class=""
										style="position: relative;width: 100%;height: 100%;">
										<image v-else
											:src="`http://chat.zwsmcn.com:8090/BinaryDownloader?action=gavartar_d&user_uid=${userId}&file_name=${item.g_id}.jpg`"
											class="" style="position: relative;width: 100%;height: 100%;">
								</view>
								<view class="name-img" v-else-if="item.userAvatar != ''  && item.userAvatar != '0'">
									<image
										:src="`http://chat.zwsmcn.com:8090/UserAvatarDownloader?action=ad&user_uid=${item.user_uid}&user_local_cached_avatar=${item.userAvatar}&enforceDawnload=1`"
										class="" style="position: relative;width: 100%;height: 100%;">
									</image>
								</view>
								<view class="name-img" v-else>
									{{ item.nickname == "" ? item.g_name[0] : item.nickname[0] }}

								</view>
								<view class="unread-color" v-if="item.unread_count > 0"
									style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;z-index: 11;">
								</view>
								<view
									style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
									<view
										style="margin-left: 20upx;position: relative; display: flex; align-items: center;">
										<view style="color: #1467cd; margin-right: 6px;"
											v-if="item.g_id != '' && item.g_id != '0'">[群聊]</view>
										<view v-if="item.g_id != '' && item.g_id != '0'"
											style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
											{{ item.g_name}}
										</view>
										<view v-else
											style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
											{{ item.nickname }}
										</view>

										<u-icon v-if="item.is_top == 1" name="pushpin-fill" size='20'
											style="margin: 0 10px;" /></u-icon>
										<!-- 	<image style="width: 70upx; height: 32upx; border-radius: 4px; margin-left: 4px;"
											src="../../static/image/icon-vip@3x.png"></image> -->
									</view>
									<view class="title-box">
										{{item.g_id != '' && item.g_id != '0'?(item.message.f == userId?'我:':`${item.message.nickName}:`):''}}
										{{ checkIfmsg(item.message)}}
									</view>
									<!-- <view style="margin: 45upx 0 0 20upx">
										<u-line color="#dcdcdc" length="1000%"></u-line>
									</view> -->
								</view>
								<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
									mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
								</image>
								<view style="position: absolute; right: 4vw; color: #9c9c9c; font-size: 22upx;">
									{{ formatTime(item.time) }}
								</view>
							</view>
							<view class="select-box" :class=" item.is_top? 'active':''"
								style="flex: 1;display: flex; padding:10px 30upx;" v-else-if="item.typeu == 7"
								@tap="toDetail(item)">
								<image class="name-img1" src="../../static/image/message.png" mode="aspectFit"></image>
								<view class="unread-color" v-if="item.unread_count > 0"
									style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;">
								</view>
								<view
									style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
									<view
										style="margin-left: 20upx;position: relative; display: flex;align-items: center;">

										<view style="max-width: 132px;  
										white-space: nowrap;
										overflow: hidden;
										text-overflow: ellipsis; ">系统消息</view>

										<!-- <image style="width: 70upx;height: 32upx;border-radius: 4px;margin-left: 4px;"
											src="../../static/image/icon-vip@3x.png">
										</image> -->
									</view>

									<view class="title-box">
										“{{ item.message.nickname }}”请求加您为好友
									</view>
									<!-- <view style="margin: 45upx 0 0 20upx">
											<u-line color="#dcdcdc" length="1000%"></u-line>
										</view> -->
								</view>
								<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png"
									mode="aspectFit" style="width: 20px;height: 20px;position: absolute; right: 13vw;">
								</image>
								<view style="position: absolute;right: 4%;color: #9c9c9c; font-size: 22upx;">
									{{ formatTime(item.time) }}
								</view>
							</view>

						</view>
					</uni-swipe-action-item>
				</checkbox-group>
			</uni-swipe-action>

			<uni-swipe-action ref="swipe" v-if="num==3">
				<uni-swipe-action-item v-for="(item, index) in listarr" :key="index">
					<view class="select-box" style="flex: 1; display: flex; padding:10px 30upx;" @tap="toDetail(item)">

						<view class="name-img" style="position: relative;">
							<image v-if="item.userAvatar" :src="item.userAvatar" class=""
								style="position: relative;width: 100%;height: 100%;border-radius: 10px;" />
							<!-- :src="`http://chat.zwsmcn.com:8090/BinaryDownloader?action=gavartar_d&user_uid=${userId}&file_name=${item.g_id}.jpg`" -->
							<image v-else :src="`http://chat.zwsmcn.com:8090/chatfile/avatar_group/${item.g_id}.jpg`"
								class="" style="position: relative;width: 100%;height: 100%;border-radius: 10px;" />

							<image src="../../static/image/qun.png" class="qun"></image>
						</view>
						<view class="unread-color" v-if="item.unread_count > 0"
							style="width: 10px;height: 10px;background-color: #00ff00;border-radius: 50%;margin-left: -5px;margin-top: 45px;z-index: 11;">
						</view>
						<view
							style="flex: 1;height: 100%;display: flex;flex-direction: column; justify-content: center;">
							<view style="margin-left: 20upx;position: relative; display: flex; align-items: center;">
								<view style="color: #1467cd; margin-right: 6px;"
									v-if="item.g_id != '' && item.g_id != '0'">[群聊]</view>
								<view v-if="item.g_id != '' && item.g_id != '0'"
									style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
									{{ item.g_name}}
								</view>
								<view v-else
									style="max-width: 132px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
									{{ item.nickname }}
								</view>

								<u-icon v-if="item.is_top == 1" name="pushpin-fill" size='20'
									style="margin: 0 10px;" /></u-icon>
							</view>
							<view class="title-box">
								{{item.g_id != '' && item.g_id != '0'?(item.message.f == userId?'我:':`${item.message.nickName}:`):''}}
								{{ checkIfmsg(item.message)}}
							</view>

						</view>
						<image v-if="item.is_mute == 1" class="" src="../../static/image/icon05@3x.png" mode="aspectFit"
							style="width: 20px;height: 20px;position: absolute; right: 13vw;">
						</image>
						<view style="position: absolute; right: 4vw; color: #9c9c9c; font-size: 22upx;">
							{{ formatTime(item.time) }}
						</view>
					</view>
				</uni-swipe-action-item>
			</uni-swipe-action>

		</scroll-view>

		<view class="oper " v-if="is_more && more_list.length > 0 ">
			<view class="more-item" @click="updateAllData(1)">
				<text>标记已读</text>
			</view>

			<view class="more-item" @tap="updateAllData(4)"> <text>删除</text>
			</view>
		</view>
	</view>
</template>

<script>
	// from '@/util/sqlite/sqlite.js'
	import {
		DB
	} from '@/util/sqlite/sqlite.js'
	import uniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue'
	import uniSwipeActionItem from '@/components/uni-swipe-action-item/uni-swipe-action-item.vue'



	let EventType = require("@/pages/index/utils/event-type.js");
	let EventBus = require("@/pages/index/utils/event-bus.js");
	let ToolKits = require("@/pages/index/utils/toolkits.js");
	let imManager = require("@/pages/index/utils/im-manager.js");
	
	export default {
		components: {
			uniSwipeAction,
			uniSwipeActionItem
		},
		data() {
			return {
				is_more: false,
				more_list: [],

				userId: uni.getStorageSync('userId'),
				num: '',
				nickname: '',
				activeTabIndex: 0,
				listarr: [],
				listchat: [],
				activeTabNum: 0,
				activeTab: 0, // 默认显示第一个选项 "消息"
				singlelist: [],
				unreadlist: [],
				options: [{
					text: '删除',
					style: {
						backgroundColor: '#f9828a'
					}
				}],
				posRight: '15px',
				userId: uni.getStorageSync('userId') || '',
				//list: [],
				keyword: '',
				dirlogShow: false,
				tabList: [{
					name: '消息',
					index: 0,
					count: 0,
				}, {
					name: '未读',
					index: 1,
					count: 0,
				}, {
					name: '单聊',
					index: 2,
					count: 0,
				}, {
					name: '群聊',
					index: 3,
					count: 0,
				}],
			}
		},
		onShow() {


			this.clickTabs({
				index: 0
			});
			this.getServerVersion()
			if (uni.getStorageSync("token") == "") {

				uni.setStorageSync('loginInfo', {});
				uni.setStorageSync('token', '')
				uni.setStorageSync('user_uid', '')
				uni.setStorageSync('userId', '')
				uni.setStorageSync('user_level', '')
				uni.setStorageSync('nickname', '')
				uni.setStorageSync('user_avatar_file_name', '')
				uni.setStorageSync('loginInfoArr', []);
				uni.IMSDK.disconnectSocket();
				uni.MBSocketProvider.closeLocalSocket();
				this.toPage('/pages/login');
				return;
			}
			this.registerIMEvents();

			this.getUser();

			// this.selectsystemTableData();
			// //获取离线消息
			this.getofflineMsg();
			this.getofflineFriengMsg();

			// #ifdef APP
			setTimeout(() => {
				this.selectTableData();
				this.selectAllTableData();
				this.selectTabcountData();
			}, 500)
			// #endif

			// #ifndef APP
			this.getmsgList();
			// #endif



			this.getfriendlist();
			

			// uni.$on('event2ui.onIMData', (data) =>{
			//     console.log('监听到事件来自 update, 携带参数 msg 为:' + data);
			// })
			//// this.getList()

		},
		computed: {
			// 自动筛选
			filteredList() {
				// 将搜索关键词转换为小写
				const searchQuery = this.nickname ? this.nickname.toLowerCase() : '';
				return this.listchat.filter(item => {

					// 将昵称或群名称转换为小写，并确保它们是字符串
					const name = (item.nickname || item.g_name || '').toString().toLowerCase();
					return name.includes(searchQuery);
				});
			}
		},
		mounted() {
			// 页面初始化时设置第一个 tab 为激活状态
			this.clickTabs(this.tabList[0]);
		},
		onLoad() {
			// console.log(uni.getStorageSync('user_uid'));
			// console.log('getfriendlist');
			// this.getfriendlist();

			// #ifdef MP-WEIXIN
			let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
			this.posRight = (menuButtonInfo.width + 20) + 'px'
			// #endif


		},



		methods: {
			registerIMEvents() {
				let that = this;

				// 提示：ES6的箭头函数中this指向的是外部调用者，而function()这种匿名函数则是指向它自身，别理解错

				// 注册应用层事件通知：事件发生于收到聊天消息时，此处接收通知并在UI上展现出来
				EventBus.register(EventType.onIMData, (p, options) => {

					if (p.typeu == 3 || p.typeu == 45 || p.typeu == 46 || p.typeu == 47 || p.typeu == 48 || p
						.typeu == 49 || p.typeu == 50 || p.typeu == 51 || p.typeu == 7 || p.typeu == 43) {

						setTimeout(() => {
							that.selectAllTableData();
							that.selectTableData();
							that.selectTabcountData();
						}, 500)

					}

				});

				// 注册应用层事件通知：事件发生于客户端成功登陆/认证后，此处接收通知并在UI上展开相关逻辑
				EventBus.register(EventType.onIMAfterLoginSucess, () => {
					// 设置已成功登录标识并通知ui刷新
					that.loginSucess = true;
					// 刷新网络连接情况的ui显示
					// that.refreshConnectionStatus();
				});

				// 注册应用层事件通知：事件发生于客户端登陆/认证失败后（可能是被禁、token/密码被重置等，具体由服务端决定）
				EventBus.register(EventType.onIMAfterLoginFailed, (isReconnect) => {
					imManager.log('对不起，你' + (isReconnect ? '自动重连' : '登陆') + 'IM服务器失败了 ...', false);
				});

				// 注册应用层事件通知：事件发生于客户端与服务器的网络断开后
				EventBus.register(EventType.onIMDisconnected, () => {
					imManager.log('Sorry，你掉线了 ...', false);
					// 刷新网络连接情况的ui显示
					// that.refreshConnectionStatus();
				});

				// 注册应用层事件通知：事件发生于客户端掉线重连成功后
				EventBus.register(EventType.onIMReconnectSucess, () => {
					imManager.log('掉线自动重连成功了!', false);
					// 刷新网络连接情况的ui显示
					// that.refreshConnectionStatus();
				});

				// 注册应用层事件通知：事件发生于客户端收到服务端的心跳响应包，此事件对于应用层无实质性意义，一般无需理会
				EventBus.register(EventType.onIMPong, () => {
					// 绿色呼吸灯效果（表示心跳在后面正常工作中...）
					// that.setConnectionStatusIconLight(true);
					// setTimeout(function() {
					// 	that.setConnectionStatusIconLight(false);
					// }, 500);
				});

				// 注册应用层事件通知：事件发生于聊天消息/指令未成功送达时，此处接收通知可在UI界面上标记未送出的消息
				EventBus.register(EventType.onMessagesLost, (lostMessages) => {
					imManager.log("[DEMO-UI] [消息未成功送达]共" + lostMessages.length + "条!(网络状况不佳或对方id不存在)", true);
					// // 更新ui显示（显示一个未送红色小图标）
					// that.updateMessagesSendStatus(lostMessages, -1);
				});

				// 注册应用层事件通知：事件发生于聊天消息/指令已被对方收到，此处接收通知可在UI界面上标记已送达的消息
				EventBus.register(EventType.onMessagesBeReceived, (theFingerPrint) => {
					imManager.log("[DEMO-UI] [收到消息应答]fp=" + theFingerPrint, true);
					// 更新ui显示
					// that.updateMessageSendStatus(theFingerPrint, 1);
				});
			},
			// 输入事件
			onInput() {
				// 每次输入时触发模糊查询（通过计算属性触发）
				clearTimeout(this.timer);
				this.timer = setTimeout(() => {
					// 在这里可以添加额外的逻辑，例如向后台请求数据或做其他操作
					console.log('查询内容：', this.nickname);
				}, 500); // 设置500ms的延时来避免频繁查询
			},
			formatTime(timeStr) {
				const currentDate = new Date(); // 当前时间
				const targetDate = new Date(timeStr);

				const yesterday = new Date(currentDate);
				yesterday.setDate(currentDate.getDate() - 1);

				const oneDayMs = 24 * 60 * 60 * 1000; // 一天的毫秒数
				const diffDays = Math.floor((currentDate.getTime() - targetDate.getTime()) / oneDayMs);
				if (currentDate.getFullYear() === targetDate.getFullYear() &&
					currentDate.getMonth() === targetDate.getMonth() &&
					currentDate.getDate() === targetDate.getDate()) {
					const hours = targetDate.getHours().toString().padStart(2, '0');
					const minutes = targetDate.getMinutes().toString().padStart(2, '0');
					const seconds = targetDate.getSeconds().toString().padStart(2, '0');
					return `${hours}:${minutes}`;
				} else if (targetDate.getFullYear() === yesterday.getFullYear() &&
					targetDate.getMonth() === yesterday.getMonth() &&
					targetDate.getDate() === yesterday.getDate()) {
					return '昨天';
				} else {
					return targetDate.toISOString().slice(0, 10);
				}
			},
			formatTime1(timeStr) {
				const currentDate = new Date(); // 当前时间
				const targetDate = new Date(timeStr);
				const oneDayMs = 24 * 60 * 60 * 1000; // 一天的毫秒数
				const diffDays = Math.floor((currentDate.getTime() - targetDate.getTime()) / oneDayMs);
				if (diffDays === 0) {
					const hours = targetDate.getHours().toString().padStart(2, '0');
					const minutes = targetDate.getMinutes().toString().padStart(2, '0');
					const seconds = targetDate.getSeconds().toString().padStart(2, '0');
					return `${hours}:${minutes}`;
				} else if (diffDays === 1) {
					return '昨天';
				} else {
					return targetDate.toISOString().slice(0, 10);
				}
			},
			getnotices() {
				this.toPage('/pages/mine/vipOpen/announcementx');
				// ?groupId=' + JSON.stringify(item)
			},
			checkIfmsg(str) {

				if (str.ty == 0) {
					return str.m
				} else if (str.ty == 1) {
					return '[图片]'
				} else if (str.ty == 2) {
					return '[语音]'
				} else if (str.ty == 3) {
					return '[赠送礼品]'
				} else if (str.ty == 4) {
					return '[索取礼品]'
				} else if (str.ty == 5) {
					return '[文件]'
				} else if (str.ty == 6) {
					return '[短视频]'
				} else if (str.ty == 7) {
					return '[个人名片]'
				} else if (str.ty == 8) {
					return '[位置]'
				} else if (str.ty == 11) {
					return '[笔记]'
				} else if (str.ty == 10) {
					return '[红包]'
				} else if (str.ty == 12) {
					return '[转账]'
				} else if (str.ty == 16) {
					return '[圈子名片]'
				} else if (str.ty == 31) {
					if (str.m.type == 'video') {
						return '[视频通话]'
					} else {
						return '[语音通话]'
					}
				} else if (str.ty == 90) {
					return str.m
				} else if (str.ty == 91) {
					return '消息撤回'
				}
			},
			checkIfJpg(str) {
				return str.slice(-3).toLowerCase() === 'jpg';


			},
			// 关闭滑块
			closeSwipe() {
				this.$refs.swipe.closeOther()
			},

			checkboxChange(e) {

				let checkedArray = e.detail.value;
				console.log(checkedArray);
				this.more_list = [];
				checkedArray.forEach(newCheckedItem => {
					this.more_list.push("'" + newCheckedItem.relatedId + "'");

				});
			},
			updateAllData(type) {

				if (this.more_list.length == 0) {
					return
				}

				const fpList = this.more_list.join(',');


				let data = '';
				let where = '';
				let key = '';

				if (type == 1) {
					data = `is_read = 1`;
					where = `relatedId IN  (${fpList})`
				}
				if (type == 4) {
					data = `del_flag = 1`;
					where = `relatedId IN  (${fpList})`
				}

				// 修改表数据 DB.updateTableData(表名, 要修改的列名=修改后列值, 修改条件的列名, 修改条件的列值)
				DB.updateTableData("chat" + uni.getStorageSync("user_uid"), data, where)
					.then(res => {
						console.log(res);
						this.is_more = false;
						this.more_list = [];

						this.selectTableData();
						this.selectAllTableData();

						this.selectTabcountData();

					})
					.catch(error => {
						console.log("修改失败", error);
					});
			},

			// 详情
			toDetail(item) {
				console.log(item)
				if (item.typeu == 7) {
					this.toPage('/pages/message/newfriend?type=1');
				} else if (item.typeu == 42 || item.typeu == 43) {
					this.$api.globalData = item;
					uni.setStorageSync('globalData', this.$api.globalData)
					this.toPage('/pages/index/index?typeu=42');
					// this.toPage('/pages/index/index?typeu=42&groupId=' + JSON.stringify(item));
				} else if (item.ty == 90) {
					this.$api.globalData = item;
					uni.setStorageSync('globalData', this.$api.globalData)
					this.toPage('/pages/index/index');
					// this.toPage('/pages/index/index?groupId=' + JSON.stringify(item));
				} else {
					this.$api.globalData = item;
					uni.setStorageSync('globalData', this.$api.globalData)
					this.toPage('/pages/index/index');
					// this.toPage('/pages/index/index?groupId=' + JSON.stringify(item));
				}


			},
			// 切换
			swipeChange() {},
			// 处理消息类型
			dealMessage(msg = '', type = 'text') {
				let ret = msg;
				switch (type) {
					case 'voice':
						ret = '语音消息';
						break
					case 'image':
						ret = '图片';
						break
					case 'map':
						ret = '位置信息';
						break
					default:
						ret = msg
				}
				return ret
			},

			delItem(e, index) {
				console.log(e)
				console.log(index)

				this.$refs.slideLeft[e.index].refreshPage();
				this.updatedata(e.item, index);


			},
			updatedata(message_item, btn_index) {
				let where = '';
				let data = '';
				console.log(message_item);
				if (btn_index == 0) {
					let is_mute = 0;
					if (message_item.is_mute == 0) {
						is_mute = 1;
					} else {
						is_mute = 0;
					}
					let disturbhashMap = uni.getStorageSync('disturbhashMap' + uni.getStorageSync("user_uid"));
					if (disturbhashMap) {
						disturbhashMap = new Map(JSON.parse(disturbhashMap));
						disturbhashMap.set(message_item.relatedId, Boolean(is_mute));
						uni.setStorageSync('disturbhashMap' + uni.getStorageSync("user_uid"), JSON.stringify(Array.from(
							disturbhashMap)))
					} else {
						disturbhashMap = new Map();
						disturbhashMap.set(message_item.relatedId, Boolean(is_mute));
						uni.setStorageSync('disturbhashMap' + uni.getStorageSync("user_uid"), JSON.stringify(Array.from(
							disturbhashMap)))
					}
					data = `is_mute = ${is_mute}`
					where = `relatedId = '${message_item.relatedId}'`
					console.log(uni.getStorageSync('disturbhashMap' + uni.getStorageSync("user_uid")));

				} else if (btn_index == 1) {
					let is_top = 0;
					if (message_item.is_top == 0) {
						is_top = 1;
					} else {
						is_top = 0;
					}
					let tophashMap = uni.getStorageSync('tophashMap' + uni.getStorageSync("user_uid"));
					if (tophashMap) {
						tophashMap = new Map(JSON.parse(tophashMap));
						tophashMap.set(message_item.relatedId, Boolean(is_top));
						uni.setStorageSync('tophashMap' + uni.getStorageSync("user_uid"), JSON.stringify(Array.from(
							tophashMap)))
					} else {
						tophashMap = new Map();
						tophashMap.set(message_item.relatedId, Boolean(is_top));
						uni.setStorageSync('tophashMap' + uni.getStorageSync("user_uid"), JSON.stringify(Array.from(
							tophashMap)))
					}
					console.log(uni.getStorageSync('tophashMap' + uni.getStorageSync("user_uid")))

					data = `is_top = ${is_top}`
					where = `relatedId = '${message_item.relatedId}'`
				} else if (btn_index == 2) {
					data = `del_flag = 1`
					where = `relatedId = '${message_item.relatedId}'`
				}


				// 修改表数据 DB.updateTableData(表名, 要修改的列名=修改后列值, 修改条件的列名, 修改条件的列值)
				DB.updateTableData("chat" + uni.getStorageSync("user_uid"), data, where)
					.then(res => {
						this.selectAllTableData();

						this.selectTabcountData();
						this.$forceUpdate();
					})
					.catch(error => {
						console.log("修改失败", error);
					});
			},

			clickTabs(item) {

				this.activeTabIndex = item.index; // Update the active tab 
				const currentDate = new Date();
				const year = currentDate.getFullYear();
				const month = String(currentDate.getMonth() + 1).padStart(2, '0');
				const day = String(currentDate.getDate()).padStart(2, '0');
				const hours = String(currentDate.getHours()).padStart(2, '0');
				const minutes = String(currentDate.getMinutes()).padStart(2, '0');
				const seconds = String(currentDate.getSeconds()).padStart(2, '0');
				const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;

				// 将newDataObj里的starttime属性更新为当前时间
				var starttime = formattedTime;
				this.num = item.index
				if (this.num == 0) {
					this.selectAllTableData();
					return;


				}
				if (this.num == 1) {
					this.selectTableData();
					return

				}
				if (this.num == 2) {
					this.selectsingleTableData();
					return

				}
				// 获取群聊
				if (this.num == 3) {
					this.selectgroupTableData();
					return
					console.log(123)
					var requestData = {
						"processorId": '1016',
						"jobDispatchId": '25',
						"actionId": '7',
						"token": '23123',
						"newData": uni.getStorageSync("user_uid")
					};
					const requestDataJsonStr = JSON.stringify(requestData);
					uni.request({
						url: 'http://chat.zwsmcn.com:8090/rest_post',
						header: {
							'content-type': 'application/json'
						},
						data: requestDataJsonStr,
						method: 'POST',
						success: res => {
							const updateInfoStr = JSON.parse(res.data.returnValue);
							this.listarr = updateInfoStr;
							// this.listarr = updateInfoObj
							// console.log(this.listarr.length)
							console.log(this.listarr)
						},
						fail: res => {
							console.log(res);
						}
					});
				}

			},
			handleDirlog() {
				this.dirlogShow = true
			},
			getmsgList() {
				const newDataObj = {
					"uid": uni.getStorageSync("user_uid"),
					"starttime": "2019-12-22 13:46:00"
				};
				const newDataJsonStr = JSON.stringify(newDataObj);
				const requestData = {
					"processorId": '1008',
					"jobDispatchId": '26',
					"actionId": '7',
					"newData": newDataJsonStr
				};
				const requestDataJsonStr = JSON.stringify(requestData);
				uni.request({
					url: 'http://chat.zwsmcn.com:8090/rest_post',
					header: {
						'content-type': 'application/json'
					},
					data: requestDataJsonStr,
					method: 'POST',
					success: res => {
						const arr = JSON.parse(res.data.returnValue);
						console.log(arr);
						this.listchat = [...arr.map((subArr) => {

							var dataContent_z = {};

							if (subArr[9] == '' || subArr[9] == '0') {
								dataContent_z.t = subArr[0];
								dataContent_z.cy = 2;
								dataContent_z.m = subArr[3];
								dataContent_z.ty = subArr[2];
								dataContent_z.quote_status = ''; //a引用状态
								dataContent_z.quote_type = ''; //引用类型
								dataContent_z.f = uni.getStorageSync("user_uid");
								dataContent_z.nickName = subArr[1];
							} else {
								dataContent_z.at = []; // at;
								dataContent_z.QoS = true;
								dataContent_z.nickName = subArr[1];
								dataContent_z.cy = 2;
								dataContent_z.f = uni.getStorageSync("user_uid");
								dataContent_z.m = subArr[3];
								dataContent_z.t = subArr[9];
								dataContent_z.ty = subArr[2];
								dataContent_z.quote_status = '';
								dataContent_z.quote_type = '';
								dataContent_z.parentFp = '';

							}

							return {
								user_uid: subArr[0],
								nickname: subArr[1],
								status: subArr[2],
								ty: subArr[2],
								message: dataContent_z, // subArr[3],
								time: subArr[4],
								timestamp: subArr[5],
								relatedId: subArr[6],
								flag: subArr[7],
								count: subArr[8],
								g_id: subArr[9],
								g_name: subArr[10],
								extra3: subArr[11]
							}
						})];
						console.log(this.listchat);
					},
					fail: res => {
						console.log(res);
					}
				});
			},

			getofflineMsg() {
				console.log('getofflineMsg');
				const newDataObj = {
					"user_uid": uni.getStorageSync("user_uid"),
				};
				const newDataJsonStr = JSON.stringify(newDataObj)
				var requestData = {
					"processorId": '1008',
					"jobDispatchId": '4',
					"actionId": '8',
					// "token": '23123',
					"newData": newDataJsonStr
				};
				const requestDataJsonStr = JSON.stringify(requestData);

				// console.log(requestDataJsonStr);
				uni.request({
					// url: 'http://chat.zwsmcn.com:8090/rest_post',
					url: 'http://chat.zwsmcn.com:8090/rest_post',
					header: {
						'content-type': 'application/json'
					},
					data: requestDataJsonStr,
					method: 'POST',
					success: res => {


						const arr = JSON.parse(res.data.returnValue);
						console.log(arr);

						arr.map(item => {

							var dataContent_z = {};
							let typeu = '';
							let to_user_id = '';
							let from_user_id = '';


							if (item.group_id == '' || item.group_id == '0') {
								dataContent_z.f = item.user_uid;
								dataContent_z.ty = item.msg_type;
								from_user_id = item.user_uid;

								let msg_content = JSON.parse(item.msg_content)
								console.log(msg_content);
								if (item.user_uid == 10000) {

									dataContent_z.f = msg_content.sender;
									dataContent_z.ty = 9;
									from_user_id = msg_content.sender;

								}
								dataContent_z.t = item.friend_user_uid;
								dataContent_z.cy = 2;
								dataContent_z.quote_status = item.quote_status; //a引用状态
								dataContent_z.m = item.msg_content;
								dataContent_z.quote_type = item.quote_type; //引用类型

								typeu = 3;
								to_user_id = item.friend_user_uid;

								dataContent_z.nickName = item.nickName;
								dataContent_z.receivernickName = item.receivernickName ?? '';
								dataContent_z.receiveruserAvatar = item.receiveruserAvatar ?? '';
								dataContent_z.userAvatar = item.userAvatar ?? '';;

							} else {


								dataContent_z.at = item.be_at; // at;
								dataContent_z.QoS = true;
								dataContent_z.nickName = item.nickName;
								dataContent_z.userAvatar = item.userAvatar ?? '';;;
								dataContent_z.cy = 2;
								dataContent_z.f = item.user_uid;
								dataContent_z.m = item.msg_content;
								dataContent_z.t = item.group_id;

								dataContent_z.g_name = item.group_name;
								dataContent_z.ty = item.msg_type;
								dataContent_z.quote_status = item.quote_status;
								dataContent_z.quote_type = item.quote_type;
								dataContent_z.parentFp = item.parentFp;
								typeu = 45;
								to_user_id = item.group_id;
								from_user_id = 0;
							}


							if (item.user_uid != 10000) {
								console.log('-------122122');
								let p = uni.MBProtocalFactory.createGroupProtocal(item.chat_type, JSON
									.stringify(dataContent_z), from_user_id, to_user_id, true,
									null,
									typeu);


								console.log(item);
								console.log(p);
								if (item.msg_type != 91) {


									p.to = uni.getStorageSync("user_uid");
									if (item.history_time2) {
										// item.history_time2.length > 10 ? item.history_time2.slice(0, -3):item.history_time2 
										p.time = this.$util.turnTime_Java(Number(item.history_time2),
											'seconds')
									}

									this.insertTableData(p)
								} else {
									let update_data = JSON.parse(p.dataContent);
									let dataContent1 = JSON.parse(p.dataContent);
									console.log(dataContent1);
									update_data.m = '消息撤回';
									let update_data_str = JSON.stringify(update_data);
									p.dataContent = update_data_str;
									if (dataContent1.m.indexOf('fpForMessage') >= 0) {
										let m = JSON.parse(dataContent1.m)
										let data = `dataContent = '${update_data_str}'`;

										let where = `fp = '${m.fpForMessage}'`
										// 修改表数据 DB.updateTableData(表名, 要修改的列名=修改后列值, 修改条件的列名, 修改条件的列值)
										DB.updateTableData("chat" + uni.getStorageSync("user_uid"),
												data, where)
											.then(res => {

											})
											.catch(error => {
												console.log("修改失败", error);
											});
									}
								}


							} else {
								console.log('12331');
							}


						})



					},
					fail: res => {
						console.log(res);
					},
					complete: res => {
						// console.log('complete');
					}
				});
			},
			getofflineFriengMsg() {
				const newDataObj = {
					"user_uid": uni.getStorageSync("user_uid"),
				};
				const newDataJsonStr = JSON.stringify(newDataObj)
				var requestData = {
					"processorId": '1008',
					"jobDispatchId": '4',
					"actionId": '7',
					// "token": '23123',
					"newData": uni.getStorageSync("user_uid"), //newDataJsonStr
				};
				const requestDataJsonStr = JSON.stringify(requestData);
				uni.request({
					url: 'http://chat.zwsmcn.com:8090/rest_post',
					header: {
						'content-type': 'application/json'
					},
					data: requestDataJsonStr,
					method: 'POST',
					success: res => {
						// console.log(res)
						// console.log(res.data.returnValue)
						const arr = JSON.parse(res.data.returnValue);
						console.log(arr)
						arr.map(item => {
							// console.log(item)
							var dataContent_z = {};
							let typeu = '';
							let to_user_id = '';
							let from_user_id = '';


							dataContent_z.t = uni.getStorageSync("user_uid");
							dataContent_z.user_uid = item.user_uid;
							dataContent_z.cy = 2;
							dataContent_z.quote_status = ''; //a引用状态
							dataContent_z.m = '';
							dataContent_z.nickname = item.nickname;
							dataContent_z.ty = 90;
							dataContent_z.quote_type = ''; //引用类型
							dataContent_z.f = 0 //item.user_uid;
							typeu = 7;
							to_user_id = uni.getStorageSync("user_uid");
							from_user_id = item.user_uid;



							// console.log(dataContent_z)

							let p = uni.MBProtocalFactory.createGroupProtocal(item.chat_type, JSON
								.stringify(dataContent_z), from_user_id, to_user_id, true, null,
								typeu);
							p.type = 2;
							p.gid = 0;
							// console.log(item.user_uid)
							// console.log(this.userId)
							// console.log(uni.getStorageSync("user_uid"))
							if (item.user_uid != uni.getStorageSync("user_uid")) {
								this.insertTableData(p)

							}
						})



					},
					fail: res => {
						console.log(res);
					}
				});
			},
			insertTableData(p) {
				// console.log(p)
				let open = DB.isOpen();
				// console.log(open)
				if (open) {
					if (p.typeu == 7) {
						let dataContent = JSON.parse(p.dataContent);
						let dataContent_z = JSON.parse(p.dataContent);


						let from = '';
						if (p.from && p.from != 0) {
							from = p.from
						} else if (dataContent_z.user_uid && dataContent_z.user_uid != 0) {
							from = dataContent_z.user_uid;
						} else {
							from = 0;
						}
						// console.log(from);

						let where = `typeu = 7 and from1 = '${from}' and del_flag = 0`;
						// let where = `typeu = 7 and relatedId = '${from}' and del_flag = 0`;
						this.DB.selectTableDataNew("chat" + uni.getStorageSync("user_uid"), where)
							.then(res => {
								// console.log(res.length)
								if (res.length == 0) {
									let arr = []
									arr.push(p)
									// 如果需要根据p参数插入新数据，可以在这里正确处理p与arr的关系，例如arr.push(p)等操作

									arr.map(item => {
										// console.log(item, 'arr-=-=-=-=-=arr-=-=-=-')
										let dataContent = JSON.parse(item.dataContent);
										let chat_type = dataContent.ty

										let time = p.time ?? uni.MBUtils.formatDate(new Date(),
											'yyyy-MM-dd hh:mm:ss');
										let sm = 0;
										if (item.sm) {
											sm = item.sm;
										}
										let gid = 0;
										let relatedId = '';
										relatedId = 0;

										let disturbhashMap = uni.getStorageSync('disturbhashMap' + uni
											.getStorageSync("user_uid"));
										let tophashMap = uni.getStorageSync('tophashMap' + uni.getStorageSync(
											"user_uid"));

										let is_top = 0;
										let is_mute = 0;
										if (disturbhashMap) {
											disturbhashMap = new Map(JSON.parse(disturbhashMap));
											is_mute = disturbhashMap.get(relatedId) ?? false;
											is_mute = Number(is_mute) ?? 0;
										}
										if (tophashMap) {
											console.log(tophashMap);
											console.log(is_top);
											tophashMap = new Map(JSON.parse(tophashMap));

											is_top = tophashMap.get(relatedId) ?? false;
											is_top = Number(is_top) ?? 0;
										}




										let sql =
											`'${item.type}', '${item.dataContent}', '${item.from}', '${item.to}', '${item.QoS}', '${item.typeu}', '${sm}', '${item.fp}', '0', '${time}', '${gid}',0,0, '${chat_type}','${relatedId}',${is_top},${is_mute}`;
										console.log(sql, "-=-=-=-=-=sas")
										// this.info
										let condition =
											'type, dataContent, from1, to1, QoS, typeu, sm, fp, retryCount, time,gid,is_collect,del_flag,chat_type,relatedId,is_top,is_mute';
										// 新增 DB.insertTableData(表名, 对应表头列的数据)

										// console.log('insertTableData4')
										DB.insertTableData("chat" + uni.getStorageSync("user_uid"), sql,
												condition)
											.then(res => {
												console.log("新增数据成功");
												this.selectTableData();
											})
											.catch(error => {
												console.log("失败", error);
											});
									})
								}
							})
							.catch(error => {
								// console.log("查询失败", error);
								if (String(error.code) == '-1404' || error.code == -1404) {
									// console.log(error.code);
									this.createTable();
								}

							});
					} else {
						let arr = []
						arr.push(p)
						// 如果需要根据p参数插入新数据，可以在这里正确处理p与arr的关系，例如arr.push(p)等操作

						arr.map(item => {
							console.log(item, 'arr-=-=-=-=-=arr-=-=-=-')
							let dataContent = JSON.parse(item.dataContent);
							let chat_type = dataContent.ty

							let time = p.time ?? uni.MBUtils.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss');
							let sm = 0;
							if (item.sm) {
								sm = item.sm;
							}
							let gid = 0;
							if (p.typeu == 45) {
								gid = JSON.parse(item.dataContent).t;

								chat_type = JSON.parse(item.dataContent).ty;
							} else if (p.typeu == 47 || p.typeu == 50 || p.typeu == 49 || p.typeu ==
								48) {
								gid = JSON.parse(item.dataContent).t;

								chat_type = 90;
							} else if (p.typeu == 46) {
								gid = JSON.parse(item.dataContent).g_id;
								chat_type = 90;
							} else if (p.typeu == 51) {
								gid = JSON.parse(item.dataContent).gid;
								chat_type = 90;
							}
							if (p.typeu == 10) {
								gid = 0;
								chat_type = 90;
								item.from = JSON.parse(item.dataContent).user_uid;
							}
							let relatedId = '';
							if (gid == '' || gid == 0 || gid == '0') {
								if (item.from == uni.getStorageSync('user_uid')) {
									relatedId = item.to;
								} else {
									// relatedId = item.from;
									if (item.from && item.from != 0) {
										relatedId = item.from;
									} else if (dataContent.user_uid && dataContent.user_uid != 0) {
										relatedId = dataContent.user_uid;
									} else {
										relatedId = 0;
									}
								}
							} else {
								relatedId = gid;
							}
							let disturbhashMap = uni.getStorageSync('disturbhashMap' + uni.getStorageSync(
								"user_uid"));
							let tophashMap = uni.getStorageSync('tophashMap' + uni.getStorageSync("user_uid"));

							let is_top = 0;
							let is_mute = 0;
							if (disturbhashMap) {
								disturbhashMap = new Map(JSON.parse(disturbhashMap));
								is_mute = disturbhashMap.get(relatedId) ?? false;
								is_mute = Number(is_mute) ?? 0;
							}
							if (tophashMap) {
								tophashMap = new Map(JSON.parse(tophashMap));

								is_top = tophashMap.get(relatedId) ?? false;
								is_top = Number(is_top) ?? 0;
							}






							let sql =
								`'${item.type}', '${item.dataContent}', '${item.from}', '${item.to}', '${item.QoS}', '${item.typeu}', '${sm}', '${item.fp}', '0', '${time}', '${gid}',0,0, '${chat_type}','${relatedId}',${is_top},${is_mute}`;
							console.log(sql, "-=-=-=-=-=sas")
							// this.info
							let condition =
								'type, dataContent, from1, to1, QoS, typeu, sm, fp, retryCount, time,gid,is_collect,del_flag,chat_type,relatedId,is_top,is_mute';
							// 新增 DB.insertTableData(表名, 对应表头列的数据)
							// 新增 DB.insertTableData(表名, 对应表头列的数据)

							console.log('insertTableData4')
							DB.insertTableData("chat" + uni.getStorageSync("user_uid"), sql, condition)
								.then(res => {
									console.log("新增数据成功");
									this.selectTableData();
								})
								.catch(error => {
									console.log("失败", error);
								});
						})
					}






				} else {
					this.$util.toast("数据库未打开");
				}
			},
			async selectAllTableData() {
				let open = DB.isOpen();
				// console.log("open-=-=-=-==-==-", open);
				if (open) {
					// 查询表 DB.selectTableData(表名,查询条件列名,查询条件列值)
					let userinfo;
					DB.selectAllmessageData("chat" + uni.getStorageSync("user_uid"), "to1", uni.getStorageSync(
							'user_uid'), "from1")
						.then(res => {
							// console.log("contact表数据-=-=-=-==-==-", res);

							this.listchat = [...res.map((subArr) => {

								let g_name = '';
								let nicknamehashMap = uni.getStorageSync('nicknamehashMap');
								let avatarhashMap = uni.getStorageSync('avatarhashMap');



								let nickname = '';
								let avatar = '';
								if (nicknamehashMap) {

									nicknamehashMap = new Map(JSON.parse(nicknamehashMap));
									nickname = nicknamehashMap.get(subArr.from1) ?? '';
								}
								if (avatarhashMap) {
									avatarhashMap = new Map(JSON.parse(avatarhashMap));
									avatar = avatarhashMap.get(subArr.from1) ?? '';
								}

								let dataContent = JSON.parse(subArr.dataContent)
								if (dataContent.ty == 31) {
									dataContent.m = JSON.parse(dataContent.m)
								}
								if (subArr.typeu == 46) {
									dataContent.ty = 90;
									dataContent.m = '“' + dataContent.initveBeNickName + '”邀请“”等' +
										dataContent.g_member_count + '人加入群聊';
									subArr.gid = dataContent.g_id
									subArr.g_name = dataContent.g_name
									g_name = dataContent.g_name
								} else {


									if (subArr.typeu == 45 || subArr.typeu == 47 || subArr.typeu ==
										50 || subArr.typeu == 49 || subArr.typeu == 48) {
										nickname = '';
										avatar = dataContent.receiveruserAvatar ?? '';

										g_name = dataContent.g_name
									} else if (subArr.typeu == 51) {
										nickname = '';
										subArr.gid = dataContent.gid;
										subArr.g_name = dataContent.nnewGroupName;
										g_name = dataContent.nnewGroupName
										dataContent.ty = 90
										dataContent.m = dataContent.notificationContent
									} else {
										nickname = dataContent.nickName ?? dataContent.nickname;
										avatar = dataContent.userAvatar ?? dataContent
											.userAvatarFileName;

										if (!dataContent.nickName) {
											dataContent.nickName = dataContent.nickname;
										}
										if (dataContent.f == uni.getStorageSync('user_uid')) {

											// nickname = nicknamehashMap.get(dataContent.t) ?? '';
											// avatar = avatarhashMap.get(dataContent.t) ?? '';

											// dataContent.nickname = nickname;
											nickname = dataContent.receivernickName;
											avatar = dataContent.receiveruserAvatar;
										}
									}

								}
								if (dataContent.g_name) {
									g_name = dataContent.g_name
								}

								if (subArr.typeu == 10) {
									dataContent.ty = 90;
									dataContent.m = '你们已经是好友了，现在可以好友模式聊天了。';
									nickname = dataContent.nickName;
								}
								let user_uid = dataContent.f;
								if (subArr.typeu == 10) {
									if (subArr.from1 == uni.getStorageSync('user_uid')) {
										user_uid = subArr.to1
									} else {
										user_uid = subArr.from1;
									}
								} else {
									if (dataContent.f == uni.getStorageSync('user_uid')) {
										user_uid = dataContent.t
									}
								}
								if (subArr.del_flag == 1) {
									dataContent = {};
								}
								return {
									multiSelect: false,
									is_top: subArr.is_top ?? 0,
									is_mute: subArr.is_mute ?? 0,
									user_uid: user_uid,
									nickname: nickname,
									userAvatar: avatar,
									status: '',
									message: dataContent, // subArr.dataContent,
									time: subArr.time,
									timestamp: '',
									relatedId: subArr.relatedId,
									flag: 1,
									count: 0,
									g_id: subArr.gid,
									g_name: g_name ?? '',
									extra3: '',
									typeu: subArr.typeu,
									unread_count: subArr.unread_count ?? 0,

								};
							})];
							// console.log(this.listchat);
							this.$forceUpdate();
						})

						.catch(error => {
							console.log("查询失败", error);
							if (String(error.code) == '-1404' || error.code == -1404) {
								console.log(error.code);
								this.createTable();
							}

						});
				} else {
					// this.$util.toast("数据库未打开");
					DB.openSqlite()
						.then(res => {
							console.log("数据库已打开");
						})
						.catch(error => {
							console.log("数据库开启失败");
						});
				}
			},

			async selectTabcountData() {
				let open = DB.isOpen();
				// console.log("open-=-=-=-==-==-", open);
				if (open) {
					// 查询表 DB.selectTableData(表名,查询条件列名,查询条件列值)
					let userinfo;
					DB.selectTabcountData("chat" + uni.getStorageSync("user_uid"), "to1", uni.getStorageSync(
							'user_uid'), "from1")
						.then(res => {
							console.log("contact表数据-=-=-=-==-==-", res);
							if (res.length > 0) {
								this.tabList[0].count = res[0].all_count;
								this.tabList[1].count = res[0].unread_count;
								this.tabList[2].count = res[0].single_count;
								this.tabList[3].count = res[0].group_count;
							}
							// console.log(this.listchat);
							this.$forceUpdate();
						})

						.catch(error => {
							console.log("查询失败", error);


						});
				} else {
					// this.$util.toast("数据库未打开");
					DB.openSqlite()
						.then(res => {
							console.log("数据库已打开");
						})
						.catch(error => {
							console.log("数据库开启失败");
						});
				}
			},


			// 查询表数据
			async selectTableData() {
				let open = DB.isOpen();
				// console.log("open-=-=-=-==-==-", open);
				if (open) {
					// 查询表 DB.selectTableData(表名,查询条件列名,查询条件列值)
					let userinfo;
					let where = `to1 = ${uni.getStorageSync('user_uid')}`;
					let order = ''; // `GROUP BY t2.from1`

					DB.selectmessageData("chat" + uni.getStorageSync("user_uid"), "to1", uni.getStorageSync(
							'user_uid'))
						.then(res => {
							// console.log("contact表数据-=-=-=-==-==-", res);
							// this.unreadlist = res;
							this.unreadlist = [...res.map((subArr) => {


								let g_name = '';
								let nicknamehashMap = uni.getStorageSync('nicknamehashMap');
								let avatarhashMap = uni.getStorageSync('avatarhashMap');



								let nickname = '';
								let avatar = '';
								if (nicknamehashMap) {
									nicknamehashMap = new Map(JSON.parse(nicknamehashMap));
									nickname = nicknamehashMap.get(subArr.from1) ?? '';
								}
								if (avatarhashMap) {
									avatarhashMap = new Map(JSON.parse(avatarhashMap));
									avatar = avatarhashMap.get(subArr.from1) ?? '';
								}
								let dataContent = JSON.parse(subArr.dataContent)

								if (subArr.typeu == 46) {
									dataContent.ty = 90;
									dataContent.m = '“' + dataContent.initveBeNickName + '”邀请“”等' +
										dataContent.g_member_count + '人加入群聊';
									subArr.gid = dataContent.g_id
									subArr.g_name = dataContent.g_name
									g_name = dataContent.g_name
								} else {


									if (subArr.typeu == 45 || subArr.typeu == 47 || subArr.typeu ==
										50 || subArr.typeu == 49 || subArr.typeu == 48) {
										nickname = '';
										avatar = dataContent.receiveruserAvatar ?? '';

										g_name = dataContent.g_name
									} else if (subArr.typeu == 51) {
										nickname = '';
										subArr.gid = dataContent.gid;
										subArr.g_name = dataContent.nnewGroupName;
										g_name = dataContent.nnewGroupName
										dataContent.ty = 90
										dataContent.m = dataContent.notificationContent
									} else {
										nickname = dataContent.nickName ?? dataContent.nickname;
										avatar = dataContent.userAvatar ?? dataContent
											.userAvatarFileName;

										if (!dataContent.nickName) {
											dataContent.nickName = dataContent.nickname;
										}
										if (dataContent.f == uni.getStorageSync('user_uid')) {

											// nickname = nicknamehashMap.get(dataContent.t) ?? '';
											// avatar = avatarhashMap.get(dataContent.t) ?? '';

											// dataContent.nickname = nickname;
											nickname = dataContent.receivernickName;
											avatar = dataContent.receiveruserAvatar;
										}
									}

								}
								if (dataContent.g_name) {
									g_name = dataContent.g_name
								}
								if (subArr.typeu == 10) {
									dataContent.ty = 90;
									dataContent.m = '你们已经是好友了，现在可以好友模式聊天了。';
									nickname = dataContent.nickName;
								}
								let user_uid = dataContent.f;
								if (subArr.typeu == 10) {
									if (subArr.from1 == uni.getStorageSync('user_uid')) {
										user_uid = subArr.to1
									} else {
										user_uid = subArr.from1;
									}
								} else {
									if (dataContent.f == uni.getStorageSync('user_uid')) {
										user_uid = dataContent.t
									}
								}
								if (subArr.del_flag == 1) {
									dataContent = {};
								}

								return {
									multiSelect: false,
									is_top: subArr.is_top ?? 0,
									is_mute: subArr.is_mute ?? 0,
									user_uid: user_uid, // subArr.from1,
									nickname: nickname,
									userAvatar: avatar,
									status: '',
									message: dataContent, // subArr.dataContent,
									time: subArr.time,
									timestamp: '',
									relatedId: subArr.relatedId,
									flag: 1,
									count: 0,
									g_id: subArr.gid,
									g_name: g_name ?? '',
									extra3: '',
									typeu: subArr.typeu,
									unread_count: subArr.unread_count ?? 0,
								};
							})];

							console.log(this.unreadlist);
						})

						.catch(error => {
							console.log("查询失败", error);

							if (String(error.code) == '-1404' || error.code == -1404) {
								console.log(error.code);
								this.createTable();
							}

						});
				} else {
					// this.$util.toast("数据库未打开");
					DB.openSqlite()
						.then(res => {
							console.log("数据库已打开");
						})
						.catch(error => {
							console.log("数据库开启失败");
						});
				}
			},
			async selectsingleTableData() {
				let open = DB.isOpen();
				// console.log("open-=-=-=-==-==-", open);
				if (open) {
					// 查询表 DB.selectTableData(表名,查询条件列名,查询条件列值)
					let userinfo;
					let where = `to1 = ${uni.getStorageSync('user_uid')}`;
					let order = ''; // `GROUP BY t2.from1`

					DB.selectsingleTableData("chat" + uni.getStorageSync("user_uid"), "to1", uni.getStorageSync(
							'user_uid'), "from1")
						.then(res => {
							// console.log("contact表数据-=-=-=-==-==-", res);

							this.singlelist = [...res.map((subArr) => {


								let g_name = '';
								let nicknamehashMap = uni.getStorageSync('nicknamehashMap');
								let avatarhashMap = uni.getStorageSync('avatarhashMap');



								let nickname = '';
								let avatar = '';
								if (nicknamehashMap) {
									nicknamehashMap = new Map(JSON.parse(nicknamehashMap));
									nickname = nicknamehashMap.get(subArr.from1) ?? '';
								}
								if (avatarhashMap) {
									avatarhashMap = new Map(JSON.parse(avatarhashMap));
									avatar = avatarhashMap.get(subArr.from1) ?? '';
								}
								let dataContent = JSON.parse(subArr.dataContent)

								if (subArr.typeu == 46) {
									dataContent.ty = 90;
									dataContent.m = '“' + dataContent.initveBeNickName + '”邀请“”等' +
										dataContent.g_member_count + '人加入群聊';
									subArr.gid = dataContent.g_id
									subArr.g_name = dataContent.g_name
									g_name = dataContent.g_name
								} else {


									if (subArr.typeu == 45 || subArr.typeu == 47 || subArr.typeu ==
										50 || subArr.typeu == 49 || subArr.typeu == 48) {
										nickname = '';
										avatar = dataContent.receiveruserAvatar ?? '';

										g_name = dataContent.g_name
									} else if (subArr.typeu == 51) {
										nickname = '';
										subArr.gid = dataContent.gid;
										subArr.g_name = dataContent.nnewGroupName;
										g_name = dataContent.nnewGroupName
										dataContent.ty = 90
										dataContent.m = dataContent.notificationContent
									} else {
										nickname = dataContent.nickName ?? dataContent.nickname;
										avatar = dataContent.userAvatar ?? dataContent
											.userAvatarFileName;

										if (!dataContent.nickName) {
											dataContent.nickName = dataContent.nickname;
										}
										if (dataContent.f == uni.getStorageSync('user_uid')) {

											// nickname = nicknamehashMap.get(dataContent.t) ?? '';
											// avatar = avatarhashMap.get(dataContent.t) ?? '';

											// dataContent.nickname = nickname;
											nickname = dataContent.receivernickName;
											avatar = dataContent.receiveruserAvatar;
										}
									}

								}
								if (dataContent.g_name) {
									g_name = dataContent.g_name
								}
								if (subArr.typeu == 10) {
									dataContent.ty = 90;
									dataContent.m = '你们已经是好友了，现在可以好友模式聊天了。';
									nickname = dataContent.nickName;
								}
								let user_uid = dataContent.f;
								if (subArr.typeu == 10) {
									if (subArr.from1 == uni.getStorageSync('user_uid')) {
										user_uid = subArr.to1
									} else {
										user_uid = subArr.from1;
									}
								} else {
									if (dataContent.f == uni.getStorageSync('user_uid')) {
										user_uid = dataContent.t
									}
								}
								if (subArr.del_flag == 1) {
									dataContent = {};
								}

								return {
									multiSelect: false,
									is_top: subArr.is_top ?? 0,
									is_mute: subArr.is_mute ?? 0,
									user_uid: user_uid, // subArr.from1,
									nickname: nickname,
									userAvatar: avatar,
									status: '',
									message: dataContent, // subArr.dataContent,
									time: subArr.time,
									timestamp: '',
									relatedId: subArr.relatedId,
									flag: 1,
									count: 0,
									g_id: subArr.gid,
									g_name: g_name ?? '',
									extra3: '',
									typeu: subArr.typeu,
									unread_count: subArr.unread_count ?? 0,
								};
							})];

						})

						.catch(error => {
							console.log("查询失败", error);

							if (String(error.code) == '-1404' || error.code == -1404) {
								console.log(error.code);
								this.createTable();
							}

						});
				} else {
					// this.$util.toast("数据库未打开");
					DB.openSqlite()
						.then(res => {
							console.log("数据库已打开");
						})
						.catch(error => {
							console.log("数据库开启失败");
						});
				}
			},
			async selectgroupTableData() {
				let open = DB.isOpen();
				// console.log("open-=-=-=-==-==-", open);
				if (open) {
					// 查询表 DB.selectTableData(表名,查询条件列名,查询条件列值)
					let userinfo;
					let where = `to1 = ${uni.getStorageSync('user_uid')}`;
					let order = ''; // `GROUP BY t2.from1`

					DB.selectgroupTableData("chat" + uni.getStorageSync("user_uid"), "to1", uni.getStorageSync(
							'user_uid'), "from1")
						.then(res => {
							console.log("contact表数据-=-=-=-==-==-", res);

							this.listarr = [...res.map((subArr) => {

								let g_name = '';
								let nicknamehashMap = uni.getStorageSync('nicknamehashMap');
								let avatarhashMap = uni.getStorageSync('avatarhashMap');



								let nickname = '';
								let avatar = '';
								if (nicknamehashMap) {

									nicknamehashMap = new Map(JSON.parse(nicknamehashMap));
									nickname = nicknamehashMap.get(subArr.from1) ?? '';
								}
								if (avatarhashMap) {
									avatarhashMap = new Map(JSON.parse(avatarhashMap));
									avatar = avatarhashMap.get(subArr.from1) ?? '';
								}

								let dataContent = JSON.parse(subArr.dataContent)
								if (dataContent.ty == 31) {
									dataContent.m = JSON.parse(dataContent.m)
								}
								if (subArr.typeu == 46) {
									dataContent.ty = 90;
									dataContent.m = '“' + dataContent.initveBeNickName + '”邀请“”等' +
										dataContent.g_member_count + '人加入群聊';
									subArr.gid = dataContent.g_id
									subArr.g_name = dataContent.g_name
									g_name = dataContent.g_name
								} else {


									if (subArr.typeu == 45 || subArr.typeu == 47 || subArr.typeu ==
										50 || subArr.typeu == 49 || subArr.typeu == 48) {
										nickname = '';
										avatar = dataContent.receiveruserAvatar ?? '';

										g_name = dataContent.g_name
									} else if (subArr.typeu == 51) {
										nickname = '';
										subArr.gid = dataContent.gid;
										subArr.g_name = dataContent.nnewGroupName;
										g_name = dataContent.nnewGroupName
										dataContent.ty = 90
										dataContent.m = dataContent.notificationContent
									} else {
										nickname = dataContent.nickName ?? dataContent.nickname;
										avatar = dataContent.userAvatar ?? dataContent
											.userAvatarFileName;

										if (!dataContent.nickName) {
											dataContent.nickName = dataContent.nickname;
										}
										if (dataContent.f == uni.getStorageSync('user_uid')) {

											// nickname = nicknamehashMap.get(dataContent.t) ?? '';
											// avatar = avatarhashMap.get(dataContent.t) ?? '';

											// dataContent.nickname = nickname;
											nickname = dataContent.receivernickName;
											avatar = dataContent.receiveruserAvatar;
										}
									}

								}
								if (dataContent.g_name) {
									g_name = dataContent.g_name
								}

								if (subArr.typeu == 10) {
									dataContent.ty = 90;
									dataContent.m = '你们已经是好友了，现在可以好友模式聊天了。';
									nickname = dataContent.nickName;
								}
								let user_uid = dataContent.f;
								if (subArr.typeu == 10) {
									if (subArr.from1 == uni.getStorageSync('user_uid')) {
										user_uid = subArr.to1
									} else {
										user_uid = subArr.from1;
									}
								} else {
									if (dataContent.f == uni.getStorageSync('user_uid')) {
										user_uid = dataContent.t
									}
								}
								if (subArr.del_flag == 1) {
									dataContent = {};
								}
								return {
									multiSelect: false,
									is_top: subArr.is_top ?? 0,
									is_mute: subArr.is_mute ?? 0,
									user_uid: user_uid,
									nickname: nickname,
									userAvatar: avatar,
									status: '',
									message: dataContent, // subArr.dataContent,
									time: subArr.time,
									timestamp: '',
									relatedId: subArr.relatedId,
									flag: 1,
									count: 0,
									g_id: subArr.gid,
									g_name: g_name ?? '',
									extra3: '',
									typeu: subArr.typeu,
									unread_count: subArr.unread_count ?? 0,

								};
							})];


						})

						.catch(error => {
							console.log("查询失败", error);

							if (String(error.code) == '-1404' || error.code == -1404) {
								console.log(error.code);
								this.createTable();
							}

						});
				} else {
					// this.$util.toast("数据库未打开");
					DB.openSqlite()
						.then(res => {
							console.log("数据库已打开");
						})
						.catch(error => {
							console.log("数据库开启失败");
						});
				}
			},
			async selectsystemTableData() {
				let open = DB.isOpen();
				console.log("open-=-=-=-==-==-", open);
				if (open) {
					// 查询表 DB.selectTableData(表名,查询条件列名,查询条件列值)
					let where = `typeu = 7`;
					this.DB.selectTableDataNew("chat" + uni.getStorageSync("user_uid"), where)
						.then(res => {
							console.log("contact表数据-=-=-=-==-==-", res);
						})

						.catch(error => {
							console.log("查询失败", error);
							if (String(error.code) == '-1404' || error.code == -1404) {
								console.log(error.code);
								this.createTable();
							}

						});
				} else {
					// this.$util.toast("数据库未打开");
					DB.openSqlite()
						.then(res => {
							console.log("数据库已打开");
						})
						.catch(error => {
							console.log("数据库开启失败");
						});
				}
			},
			createfriendTable() {
				let sql =
					'id INTEGER PRIMARY KEY AUTOINCREMENT, nickname text, userAvatarFileName text, user_mail text, user_sex text, user_uid text, online text,whatsUp text, online_time text,ex10 text,friendRemark text';
				// 创建表 DB.createTable(表名, 表的列)
				this.DB.createTable("friend" + uni.getStorageSync("user_uid"), sql)
					.then(res => {
						console.log("创建chat表成功", res);
					})
					.catch(error => {
						console.log("创建表失败", error);
					});
			},
			openSQL() {
				// 这个是查询有没有打开数据库
				let open = DB.isOpen();
				console.log("数据库状态", open ? "开启" : "关闭");
				if (!open) {
					DB.openSqlite()
						.then(res => {
							console.log("数据库已打开");
						})
						.catch(error => {
							console.log("数据库开启失败");
						});
				}
			},
			// 创建表
			createTable() {
				try {
					// 可能会抛出异常的代码块
					let open = DB.isOpen();
					// console.log(open);
					if (open) {
						// this.openSQL();
						// 修改后的表结构定义语句，列名不用双引号括起来
						let sql =
							'id INTEGER PRIMARY KEY AUTOINCREMENT, type text, dataContent text, from1 text, to1 text, QoS text, typeu text, sm text, fp text, retryCount text DEFAULT 0, time text,nickname text,avatar text,is_read text DEFAULT 0,gid text,is_collect text DEFAULT 0,del_flag text DEFAULT 0,chat_type text,relatedId text,is_top INTEGER DEFAULT 0,is_mute INTEGER DEFAULT 0';
						// 创建表 DB.createTable(表名, 表的列)
						DB.createTable("chat" + uni.getStorageSync("user_uid"), sql)
							.then(res => {
								console.log("创建chat表成功", res);
							})
							.catch(error => {
								console.log("创建表失败", error);
							});
					} else {
						console.log("数据库未打开");
					}
				} catch (error) {
					console.log(error);
					// 捕获到异常后执行的代码
				}




			},

			getfriendlist() {
				console.log('getfriendlist');
				const requestData = {
					"processorId": '1008',
					"jobDispatchId": '2',
					"actionId": '7',
					"newData": uni.getStorageSync('user_uid')
				};
				const requestDataJsonStr = JSON.stringify(requestData);
				uni.request({
					url: 'http://chat.zwsmcn.com:8090/rest_post',
					header: {
						'content-type': 'application/json'
					},
					data: requestDataJsonStr,
					method: 'POST',
					success: res => {

						uni.hideLoading()


						let originalArray_res = JSON.parse(res.data.returnValue)
						let originalArray = []

						let friends = [];
						let nicknamehashMap = new Map();;
						let avatarhashMap = new Map();

						originalArray_res.map(item => {
							item.online_time = item.ex13.length > 0 ? (item.ex13.length > 10 ? item
								.ex13 : item.ex13 + '000') : Math.floor(uni.MBUtils
								.getCurrentUTCTimestamp());
							originalArray.push(item);

							friends.push({
								id: item.user_uid,
								name: item.nickname
							})


							nicknamehashMap.set(item.user_uid, item.nickname);


							avatarhashMap.set(item.user_uid, item.userAvatarFileName);
							uni.setStorageSync('avatarhashMap', JSON.stringify(Array.from(
								avatarhashMap)))
							uni.setStorageSync('nicknamehashMap', JSON.stringify(Array.from(
								nicknamehashMap)))

							let online_time = item
								.online_time; // item.status_time ??Math.floor(uni.MBUtils.getCurrentUTCTimestamp())


							let sql1 =
								`'${item.nickname}', '${item.userAvatarFileName}', '${item.user_mail}', '${item.user_sex}', '${item.user_uid}', '${item.online}', '${item.whatsUp}','${online_time}','${item.ex10}','${item.friendRemark}'`;

							let condition =
								'nickname , userAvatarFileName , user_mail , user_sex , user_uid , online ,whatsUp ,online_time,ex10,friendRemark';
							// #ifdef APP
							console.log(friends)

							this.DB.insertTableData("friend" + uni.getStorageSync("user_uid"), sql1,
									condition)
								.then(res => {

								})
								.catch(error => {
									console.log("失败", error);

									if (error.code == '-1404' || error.code == -1404) {
										this.createfriendTable();
									}
								});

							// #endif
						})

						console.log(friends)

					
					},
					fail: res => {
						console.log(res);
					}
				});
			},

			getServerVersion() {
				uni.request({
					url: 'http://chat.zwsmcn.com:8090/version.json',
					header: {
						'content-type': 'application/json'
					},
					data: {

					},
					method: 'POST',
					success: res => {
						//console.log('1');
						// console.log(res);
						let name = plus.os.name;
						let versions;
						if (plus.os.name == 'iOS') {
							versions = res.data.ios.versions;
						} else {
							versions = res.data.android.versions;
						}




						plus.runtime.getProperty(plus.runtime.appid, info => {

							let newversions = versions[0].version_number; //versions[0].version;
							let oldversions = info.versionCode; // info.version;
							let is_newversions = versions[0].compelUpdate;

							console.log(versions[0].assets);

							if (newversions > oldversions && (is_newversions == 'true' ||
									is_newversions)) {

								uni.showModal({
									content: '发现新版本，是否更新？',
									cancelText: '取消',
									confirmText: '更新',
									success: res => {
										if (res.confirm) {
											//console.log('1');
											//console.log(versions[0]);
											this.downWgt(versions[0].assets);
											//console.log('用户点击确定');
										} else {
											//console.log('1');
											//console.log('用户点击取消');
										}
									}
								});
							} else {
								//console.log('1');
							}
						});
					},
					fail: res => {
						//console.log('1');
					}
				});
			},
			downWgt(wgtUrl) {
				//console.log('更新中......');
				console.log(wgtUrl);
				plus.nativeUI.showWaiting('更新中......');
				plus.downloader
					.createDownload(wgtUrl, {
						filename: '_doc/update/'
					}, (d, status) => {
						console.log(d);
						console.log(status);
						if (status == 200) {
							console.log('更新成功：' + d.filename);
							this.installWgt(d.filename); // 安装wgt包
						} else {
							//console.log('更新失败！');
							//plus.nativeUI.alert("更新失败！");
						}
						plus.nativeUI.closeWaiting();
					})
					.start();
			},
			installWgt(path) {
				//console.log('安装文件...');
				plus.nativeUI.showWaiting('安装文件...');
				plus.runtime.install(
					path, {},
					function() {
						plus.nativeUI.closeWaiting();
						//console.log('安装文件成功！');
						plus.nativeUI.alert('更新完成！', function() {
							plus.runtime.restart();
						});
					},
					function(e) {
						plus.nativeUI.closeWaiting();
						//console.log('安装文件失败[' + e.code + ']：' + e.message);
						plus.nativeUI.alert('安装文件失败[' + e.code + ']：' + e.message);
					}
				);
			},

			//扫一扫
			scanCode() {
				uni.scanCode({
					success: (res) => {
						if (res.result.length == 10) {
							uni.navigateTo({
								url: '/pages/contacts/addFriends?g_uid=' + res.result
							});
						} else {
							uni.navigateTo({
								url: '/pages/contacts/addFriends?user_uid=' + res.result
							});
						}
						console.log('扫码结果：' + res.result);
						// 扫码成功后的操作，pages/contacts/addFriends 
						// this.handleScanResult(res.result);
					},
					fail: (err) => {
						console.error('扫码失败：' + err);
					}
				});
			},


			getUser() {
				uni.request({
					url: this.$api.baseUrl + '/api/user/detail',
					header: {
						'content-type': 'application/json'
					},
					data: {
						user_uid: uni.getStorageSync('user_uid'),
					},
					method: 'POST',
					success: res => {
						// console.log(res, 'res');
						// uni.hideLoading()
						if (res.data.code == 0) {
							// this.userInfo = res.data.data
							uni.setStorageSync('nickname', res.data.data.nickname)
							uni.setStorageSync('user_avatar_file_name', res.data.data.user_avatar_file_name)
							uni.setStorageSync('user_level', res.data.data.user_level)
							// console.log(uni.getStorageSync('user_uid'));
							// console.log(uni.getStorageSync('nickname'));
							// console.log(uni.getStorageSync('user_avatar_file_name'));
							
						}
						// this.list = res.data;
					},
					fail: res => {
						console.log(res);
					}

				})
			},


		}
	}
</script>

<style lang="scss" scoped>
	.tabls {
		width: 100%;
		height: 40px;
		line-height: 40px;
		text-align: center;
		display: flex;
	}

	.bakbox {
		width: 50px;
		text-align: center;
		cursor: pointer;
	}

	.bakbox.active {
		border-bottom: 4px solid rgb(234, 66, 15);
		/* Highlight bottom border for active tab */
	}

	.qun {
		width: 14px;
		height: 14px;
		border-radius: 10px;
		position: absolute;
		bottom: 4px;
		right: 3px;
	}

	.search-box {
		width: 100%;
		// margin-left: 4%;
		background-color: #fff;
		margin-top: 20upx;
		color: #2e2e2e;

	}

	::v-deep .u-index-list__letter {
		margin-top: 120px !important;
	}

	.list {
		height: calc(100vh - 320upx);

		.item {
			width: 100vw;
			height: 160upx;
			padding: 30upx;
			box-sizing: border-box;
			align-items: flex-start;

			.cover {
				width: 100upx;
				height: 100upx;
				border-radius: 10upx;
				box-sizing: border-box;
				border: 2upx solid #f9f9f9;
				position: relative;

				.icon {
					width: 100%;
					height: 100%;
					border-radius: 10upx;
				}

				.tag {
					color: #fff;
					width: 30upx;
					height: 30upx;
					font-size: 20upx;
					border-radius: 50%;
					background-color: red;
					position: absolute;
					top: -12upx;
					right: -12upx;
					z-index: 9;

					&.empty {
						width: 20upx;
						height: 20upx;
						background-color: #F72727;
						top: -6upx;
						right: -6upx;
					}
				}
			}

			.title {
				height: 100%;
				box-sizing: border-box;
				width: calc(100vw - 130upx - 60upx);
				position: relative;

				&::after {
					content: '';
					width: 100%;
					height: 2upx;
					background-color: #F6F6F6;
					position: absolute;
					left: 0;
					bottom: -30upx;
				}

				.main {
					height: 40upx;
					margin: 6upx 0 12upx;

					.text {
						color: #333;
						font-size: 32upx;
						font-weight: 600;
					}

					.time {
						color: #666;
						font-size: 24upx;
					}
				}

				.sub {
					color: #999;
					font-size: 24upx;
				}
			}
		}
	}

	.select-box {
		// margin-top: ;
		// margin: 10upx 1% 0 0;
		padding: 15px 1%;
		display: flex;
		align-items: center;
		border-bottom: 1px solid #dcdcdc;

		.name-img {
			width: 100upx;
			height: 100upx;
			border-radius: 10px;
			background: #d54827;
			font-size: 36upx;
			text-align: center;
			line-height: 100upx;
			color: #fff;
			margin-left: 10upx;
		}

		.name-img1 {
			width: 100upx;
			height: 100upx;
			border-radius: 10px;
			font-size: 36upx;
			text-align: center;
			line-height: 100upx;
			color: #fff;
			margin-left: 10upx;
		}


		.title-box {
			margin-left: 20upx;
			font-size: 26upx;
			color: #b0b0b0;
			margin-top: 12upx;
		}

		&.active {
			background-color: #cfcfcf;
		}
	}

	::v-deep.u-badge--error {
		margin-top: -30upx;
		margin-left: -6upx !important;
		z-index: 1;
	}

	::v-deep.u-badge--not-dot {
		padding: 8upx 8upx;
	}

	::v-deep.uni-view {
		border-bottom: 2upx solid #c8c7cf;
	}

	.dirlog-box {
		width: 40%;
		background: #fff;
		border-radius: 20upx;
		padding: 10upx 30upx;
		box-shadow: 0 0 40upx #000; // 左
		box-shadow: 0 0 40upx #000; // 右
		color: #2e2e2e;
		font-weight: 300;
		position: absolute;
		right: 3%;
		top: 11%;
		z-index: 1;

		.dirlog-box1 {
			display: flex;
			padding: 30upx 10upx;

			image {
				width: 40upx;
				height: 40upx;
			}

			view {
				margin-left: 20upx;
			}
		}
	}

	.more-item {
		display: flex;
		align-items: center;
	}

	.oper {
		width: 100%;
		height: 50px;
		bottom: 0;
		position: fixed;
		padding: 0 30upx;
		box-sizing: border-box;
		border-top: 2upx solid #EEE;

		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		overflow: hidden;

	}
</style>